package gwt.trading.client;

import gwt.trading.client.util.ColorEnum;

/**
 * @author Iulian Costan (iulian.costan@gmail.com)
 *
 */
public abstract class TradingObject extends ColoredObject implements HorizontalConstrainter {

	private StockQuoteList quoteList;
	private DrawingManager drawingManager;

	public TradingObject(StockQuoteList quotes, ColorEnum color) {
		super(color);

		this.quoteList = quotes;
	}

	public HorizontalAxis getHorizontalAxis() {
		return new HorizontalAxis(getNumberOfBars(), TradingChartSettings.HORIZONTAL_AXIS_WIDTH);
	}

	public int getNumberOfBars() {
		return quoteList.getLength();
	}

	public void setDrawingManager(DrawingManager drawingManager) {
		this.drawingManager = drawingManager;
	}

	protected StockQuoteList getQuoteList() {
		return quoteList;
	}

	protected DrawingManager getDrawingManager() {
		return drawingManager;
	}

}
